
define(['angular',"text!www/article/article_info.html",'url','common'], function (angular,tpl) {
    //angular会自动根据controller函数的参数名，导入相应的服务
   function controller($scope,$rootScope,$http,$routeParams,$sce,$anchorScroll){
	   showSpin();
		rightMenu();
		 var article = function (articleId) {
	    	 this.articleId = articleId;
	    	 this.items =[];
	    	 this.baseUrl = ip+"/";
	         this.busy = false;
	     };
	     
		$scope.article =new article($routeParams.articleId);
		
		$scope.article.getInfo = function(){
	    	 if (this.busy){
	        	 hideSpin();
	        	 return;
	         }
	         this.busy = true;
	         var pro =this;
	    	 var url = cl.getArticleInfoUrl+"&callback=JSON_CALLBACK&id="+this.articleId ;
	         $http.jsonp(url).success(function (res) {
					if(res.code=="CL02015"){//获取成功
						pro.items = res.result;
					}
					hideSpin();
					pro.busy = false;
	         }.bind(this));
	     };
		$scope.article.getInfo();
		$scope.deliberatelyTrustDangerousSnippet = function() {  
	    	 return $sce.trustAsHtml($scope.article.items.content);  
    	 }; 
    	 $anchorScroll();
    };
    return {controller:controller,tpl:tpl};
});
